import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../../common.dart';

class PurchaseDetails extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Color(0xffffffff),
        title: Text('购买明细'),
        centerTitle: true,
      ),
      body: Column(
        children: [
          Expanded(
            child: ListView(
              padding: EdgeInsets.symmetric(horizontal: 15),
              children: [
                Divider(color: Color(0XFFDDDDDD), height: 40),
                Row(
                  children: [
                    ClipRRect(
                      borderRadius: BorderRadius.circular(7.0), // 设置圆角大小
                      child: Image.asset(
                        'static/aaa.png',
                        width: 80,
                        height: 80,
                        fit: BoxFit.fill,
                      ),
                    ),
                    SizedBox(width: 10),
                    Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        Text(
                          '超现实元宇宙数字艺术展厅',
                          style: TextStyle(
                            fontSize: 15,
                            color: Color(0XFF0F172B),
                            fontWeight: FontWeight.bold,
                          ),
                        ),
                        SizedBox(height: 20),
                        Row(
                          children: [
                            Column(
                              children: [
                                Text(
                                  '购买价格',
                                  style: TextStyle(
                                    fontSize: 11,
                                    color: Color(0XFF999999),
                                  ),
                                ),
                                Row(
                                  children: [
                                    Text(
                                      '99.00',
                                      style: TextStyle(
                                        fontSize: 14,
                                        color: Color(0XFF0F172B),
                                      ),
                                    ),
                                    Text(
                                      '元',
                                      style: TextStyle(
                                        fontSize: 11,
                                        color: Color(0XFF999999),
                                      ),
                                    ),
                                  ],
                                ),
                              ],
                            ),
                            SizedBox(width: 40),
                            Column(
                              children: [
                                Text(
                                  '求购数量',
                                  style: TextStyle(
                                    fontSize: 11,
                                    color: Color(0XFF999999),
                                  ),
                                ),
                                Text(
                                  '3243',
                                  style: TextStyle(
                                    fontSize: 14,
                                    color: Color(0XFF0F172B),
                                  ),
                                ),
                              ],
                            ),
                            SizedBox(width: 40),
                            Column(
                              children: [
                                Text(
                                  '已购数量',
                                  style: TextStyle(
                                    fontSize: 11,
                                    color: Color(0XFF999999),
                                  ),
                                ),
                                Text(
                                  '3243',
                                  style: TextStyle(
                                    fontSize: 14,
                                    color: Color(0XFF0F172B),
                                  ),
                                ),
                              ],
                            ),
                          ],
                        ),
                      ],
                    ),
                  ],
                ),
                SizedBox(height: 15),
                Divider(color: Color(0XFFDDDDDD)),
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    SizedBox(
                      width: 80,
                      child: Row(
                        children: [
                          Text(
                            '购入价格',
                            style: TextStyle(
                              fontSize: 12,
                              color: Color(0XFF999999),
                            ),
                          ),
                          Column(
                            children: [
                              Container(
                                margin: EdgeInsets.only(top: 8),
                                child: Icon(
                                  Icons.keyboard_arrow_up,
                                  color: Color(0XFF999999),
                                  size: 12,
                                ),
                              ),
                              Container(
                                transform: Matrix4.translationValues(
                                  0.0,
                                  -5.0,
                                  0.0,
                                ),
                                child: Icon(
                                  Icons.keyboard_arrow_down,
                                  color: Color(0XFF999999),
                                  size: 12,
                                ),
                              ),
                            ],
                          ),
                        ],
                      ),
                    ),
                    SizedBox(
                      width: 80,
                      child: Row(
                        children: [
                          Text(
                            '藏品编号',
                            style: TextStyle(
                              fontSize: 12,
                              color: Color(0XFF999999),
                            ),
                          ),
                          Column(
                            children: [
                              Container(
                                margin: EdgeInsets.only(top: 8),
                                child: Icon(
                                  Icons.keyboard_arrow_up,
                                  color: Color(0XFF999999),
                                  size: 12,
                                ),
                              ),
                              Container(
                                transform: Matrix4.translationValues(
                                  0.0,
                                  -5.0,
                                  0.0,
                                ),
                                child: Icon(
                                  Icons.keyboard_arrow_down,
                                  color: Color(0XFF999999),
                                  size: 12,
                                ),
                              ),
                            ],
                          ),
                        ],
                      ),
                    ),
                    SizedBox(
                      width: 120,
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.end,
                        children: [
                          Text(
                            '购入时间',
                            style: TextStyle(
                              fontSize: 12,
                              color: Color(0XFF999999),
                            ),
                          ),
                          Column(
                            children: [
                              Container(
                                margin: EdgeInsets.only(top: 8),
                                child: Icon(
                                  Icons.keyboard_arrow_up,
                                  color: Color(0XFF999999),
                                  size: 12,
                                ),
                              ),
                              Container(
                                transform: Matrix4.translationValues(
                                  0.0,
                                  -5.0,
                                  0.0,
                                ),
                                child: Icon(
                                  Icons.keyboard_arrow_down,
                                  color: Color(0XFF999999),
                                  size: 12,
                                ),
                              ),
                            ],
                          ),
                        ],
                      ),
                    ),
                  ],
                ),
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    SizedBox(
                      width: 80,
                      child: Text(
                        '¥100',
                        style: TextStyle(
                          fontSize: 12,
                          color: Color(0XFF0F172B),
                        ),
                      ),
                    ),
                    SizedBox(
                      width: 80,
                      child: Text(
                        '#23423',
                        style: TextStyle(
                          fontSize: 12,
                          color: Color(0XFF0F172B),
                        ),
                      ),
                    ),
                    SizedBox(
                      width: 120,
                      child: Text(
                        '2024-09-13 20:25:54',
                        style: TextStyle(
                          fontSize: 12,
                          color: Color(0XFF0F172B),
                        ),
                      ),
                    ),
                  ],
                ),
              ],
            ),
          ),
          GestureDetector(
            onTap:
                () => {
                  Get.dialog(
                    AlertDialog(
                      backgroundColor: Colors.transparent,
                      content: Stack(
                        children: [
                          Image.asset(
                            'static/web/hesuu.png',
                            width: 250,
                            fit: BoxFit.fitWidth,
                          ),
                          Positioned(
                            top: 50,
                            left: 0,
                            right: 0,
                            child: Align(
                              child: Column(
                                children: [
                                  Text(
                                    '取消委托购买',
                                    style: TextStyle(
                                      fontSize: 24,
                                      fontWeight: FontWeight.bold,
                                    ),
                                  ),
                                  SizedBox(height: 15),
                                  Text(
                                    '该委托订单未完成',
                                    style: TextStyle(
                                      fontSize: 12,
                                      fontWeight: FontWeight.bold,
                                    ),
                                  ),
                                  SizedBox(height: 5),
                                  Text(
                                    '取消后剩余的金额将原路退回',
                                    style: TextStyle(
                                      fontSize: 12,
                                      fontWeight: FontWeight.bold,
                                    ),
                                  ),

                                  Container(
                                    height: 50,
                                    margin: EdgeInsets.only(
                                      top: 50,
                                      bottom: 30,
                                    ),
                                    alignment: Alignment.center,
                                    width: 210,
                                    decoration: BoxDecoration(
                                      color: Color(0XFF0F172B),
                                      borderRadius: BorderRadius.circular(50),
                                    ),
                                    child: Text(
                                      '确认',
                                      style: TextStyle(
                                        fontSize: 16,
                                        color: Color(0XFFFFFFFF),
                                      ),
                                    ),
                                  ),
                                  GestureDetector(
                                    onTap:
                                        () => {
                                          toNamed('/web_tabs/order/entrust'),
                                        },
                                    child: Text(
                                      '取消',
                                      style: TextStyle(
                                        fontSize: 18,
                                        fontWeight: FontWeight.bold,
                                      ),
                                    ),
                                  ),
                                ],
                              ),
                            ),
                          ),
                        ],
                      ),
                    ),
                  ),
                },
            child: Container(
              width: 340,
              height: 50,
              alignment: Alignment.center,
              decoration: BoxDecoration(
                color: Color(0XFF0F172B),
                borderRadius: BorderRadius.circular(50),
              ),
              child: Text(
                '取消委托',
                style: TextStyle(fontSize: 18, color: Color(0XFFFFFFFF)),
              ),
            ),
          ),
        ],
      ),
    );
  }
}
